package com.ia2014.tp.portal2.entities;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.ia2014.tp.portal2.vo.ModuloVO;
import com.ia2014.tp.portal2.vo.ModuloPortalVO;
import com.ia2014.tp.portal2.enums.ModulosEnum;

/**
 * Representa un Modulo del Tipo Portal
 * @author Ignacio Iljin
 *
 */
@Entity
@DiscriminatorValue("portal")
public class ModuloPortal extends Modulo{

	@Column
	private String url;
	
	public ModuloPortal() {
		// TODO Auto-generated constructor stub
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	@Transient
	@Override
	public ModuloPortalVO getVO() {
		ModuloPortalVO moduloPortalVO = (ModuloPortalVO) super.getVO();
		
		moduloPortalVO.setUrl(url);
		
		return moduloPortalVO;
	}

	@Transient
	@Override
	public void setVO(ModuloVO abstractVO) {
		
		ModuloPortalVO moduloPortalVO = abstractVO.getModuloPortalVO();
		
		super.setVO(moduloPortalVO);
		
	}

	@Transient
	@Override
	protected ModuloPortalVO getVOInstance() {
		
		return new ModuloPortalVO();
	}

	@Transient
	@Override
	public boolean isModuloDeposito() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloPortal() {
		// TODO Auto-generated method stub
		return true;
	}

	@Transient
	@Override
	public boolean isModuloDespacho() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloLogistica() {
		// TODO Auto-generated method stub
		return false;
	}
	
	@Transient
	@Override
	public ModulosEnum getTipoModulo() {
		// TODO Auto-generated method stub
		return ModulosEnum.PORTAL;
	}
}
